#!/bin/bash

printf ' -------- >> git << --------\n\n'
git_install_info=$(sudo dpkg -l | grep git)
if [[ $git_install_info == '' ]]; then
    printf '  --> 没有下载过GIT，启动APT下载\n'
    sudo apt-get install -y git
else
    printf '  --> 已经下载过GIT\n'
fi
printf '\n'
printf ' --------  << git >> --------\n\n'

printf ' -------- >> tmux << --------\n\n'
tmux_install_info=$(sudo dpkg -l | grep tmux)
if [[ $tmux_install_info == '' ]]; then
    printf '  --> 没有下载过TMUX\n'
    printf '  ----> 启动APT下载\n'
    sudo apt-get install -y tmux
else
    printf '  --> 已经下载过TMUX\n\n'
fi
printf ' -------- << tmux >> --------\n\n'

printf ' -------- >> zsh << --------\n\n'
zsh_install_info=$(sudo dpkg -l | grep zsh)
if [[ $zsh_install_info == '' ]]; then
    printf '  --> 没有下载过zsh\n'
    printf '  ----> 启动apt下载\n'
    sudo apt-get install -y zsh
else
    printf '  --> 已经下载过zsh\n\n'
fi
printf ' --> 设置zsh为默认终端'
chsh -s $(which zsh)
printf ' -------- << zsh >> --------\n\n'

printf ' -------- >> .tmux << --------\n\n'
cd ~
if test -d ~/.tmux ; then
    printf ' --> .tmux存在\n\n'
else
    printf ' --> .tmux不存在，启动克隆\n\n'
    git clone https://github.com/gpakosz/.tmux.git ~
fi
ln -s -f .tmux/.tmux.conf
cp ~.tmux/.tmux.conf.local ~/.
printf ' -------- << .tmux >> --------\n'


